package kr.hkit.powerjava.chapter06.work2;

import java.util.Scanner;

public class For_work01b {
	public static void main(String[] args) {
		
		int size;  // 방법1)
		int total = 0; 
	
		Scanner input = new Scanner (System.in);
		System.out.print("첫번째 정수 입력");
		size = input.nextInt();
		int[] sum = new int[size];
		
		for (int i = 0; i <sum.length; i++) {
			System.out.print("정수 입력");
			sum[i] = input.nextInt();
		}
		
		for (int i = 0; i <sum.length; i++)
			total += sum[i];
			System.out.println(total);
	}
}
